//package com.sztz.handle;
//
//import cn.hutool.json.JSONUtil;
//import com.sztz.result.BaseResult;
//import com.sztz.result.ResultEnum;
//import com.sztz.utils.CommUtils;
//import lombok.extern.slf4j.Slf4j;
//import org.springframework.security.core.AuthenticationException;
//import org.springframework.security.web.AuthenticationEntryPoint;
//import org.springframework.stereotype.Component;
//
//import javax.servlet.http.HttpServletRequest;
//import javax.servlet.http.HttpServletResponse;
//
///**
// * 用户未通过认证授权时访问受保护资源的处理
// * @author yzy
// * @date 2023/3/21 19:39
// */
//@Component
//@Slf4j
//public class MyUnAuthenticationEntryPoint implements AuthenticationEntryPoint {
//    @Override
//    public void commence(HttpServletRequest request, HttpServletResponse response, AuthenticationException authException) {
//        log.info("用户未经过登录认证授权 MyUnAuthenticationEntryPoint: {}",authException.getMessage());
//        CommUtils.responseJsonMessage(response,JSONUtil.toJsonStr(BaseResult.fail(ResultEnum.USER_UNAUTHORIZED)));
//    }
//}
